"""web URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url
from . import views

urlpatterns = [

    # 首页
    url(r'^$', views.index,name='index'),
    # 列表
    url(r'^list/(?P<tid>[0-9]+)/$', views.list,name='list'),
    # 详情
    url(r'^info/(?P<gid>[0-9]+)/$', views.info,name='info'),
    # 注册
    url(r'^register/$', views.register,name='register'),
    # 登录
    url(r'^login/$', views.login,name='login'),
    # 退出
    url(r'^logout/$', views.logout,name='logout'),





    # 购物车
    url(r'^cart/list/$', views.cartlist,name='cartlist'),
    # 加入购物车
    url(r'^cart/add/$', views.cartadd,name='cartadd'),
    # 清空购物车
    url(r'^cart/clear/$', views.cartclear,name='cartclear'),
    
    # 购物车商品数量增加
    url(r'^cart/list/numadd/$', views.cartlistnumadd,name='cartclearnumadd'),

    url(r'^cart/list/numreduce/$', views.cartlistnumreduce,name='cartclearnumreduce'),

    # 删除购物车中的商品
    url(r'^cart/list/del/$', views.cartlistdel,name='cartlistdel'),

    # 下单
    # 订单确认
    url(r'^order/confirm/$', views.orderconfirm,name='orderconfirm'),
    # 生成订单
    url(r'^order/create/$',views.ordercreate,name="ordercreate"),
    # 付款
    url(r'^order/buy/$',views.orderbuy,name="orderbuy"),

    # 我的订单
    url(r'^myorder/$',views.myorder,name="myorder"),
    # 订单详情
    url(r'^myorder/info/(?P<oid>[0-9]+)$', views.myorderinfo,name='myorderinfo'),
    

    # 个人中心
    url(r'^member/$',views.member,name="member"),
    # 编辑个人信息
    url(r'^useredit/(?P<uid>[0-9]+)$',views.useredit,name="useredit"),
    # 执行个人信息修改
    url(r'^userupdate/$',views.userupdate,name="userupdate"),

    # 新增地址
    url(r'^address/add/$',views.addressadd,name="addressadd"),
    # 地址删除
    url(r'^address/del/$',views.addressdel,name="addressdel"),
    # 地址编辑
    url(r'^address/edit/$',views.addressedit,name="addressedit"),


]